//此文件定义处理视频的方法

//1. 根据视频类型获取视频
function getVideoByType(videos, type_Value) {
  console.log('getVideoByType被调用')
  //获取视频类型
  let typeList =[]
  for(let i=0;i<videos.length;i++){
    typeList.push(videos[i].videoType)
  }
  //获取符合条件的视频下标
  let index = []
  for(let j =0;j<typeList.length;j++){
    if(typeList[j] === type_Value){
      index.push(j)
    }
  }
  //获取对应视频
  let videoList = []
  for(let m =0;m<index.length;m++){
    videoList.push(videos[index[m]])
  }
  //返回视频数组
  return videoList
}

//2. 根据upId获取up昵称    //后端发送到的数据应提供nickName 方便前端渲染
const upId_nickName ={
  //key为upId value为nickName
  "2ee93b1b2c624b43a66d9225d58af4b8":'sky'
}
function getNicknameByUpId(upId){
  return upId_nickName.upId
}

export default getVideoByType
